package vn.fpt.fsoft.entity;

import java.util.Set;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.OneToMany;

/*
 * Entity.
 *
 * Version 1.0
 *
 * 22-August-2014
 *
 * Modification Logs:
 * DATE                 AUTHOR              DESCRIPTION
 * --------------------------------------------------------
 * 22-August-2014       NguyenTuyen          Country
 */
@Entity
public class Country implements java.io.Serializable {
    
    /**
     * Serial version.
     */
    private static final long serialVersionUID = 1L;
    
    /**
     * CountryID.
     */
    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    @Column(name = "CountryID", nullable = false)
    private int countryID;
    
    /**
     * CountryName.
     */
    @Column(name = "CountryName", nullable = false, length = 45)
    private String countryName;
    
    /**
     * Mapping with county.
     */
    @OneToMany(mappedBy = "country")
    private Set<County> county;
    
    @OneToMany(mappedBy = "country")
    private Set<TrustRegion> trustRegion;
    
    public Set<TrustRegion> getTrustRegion() {
        return trustRegion;
    }
    
    public void setTrustRegion(Set<TrustRegion> trustRegion) {
        this.trustRegion = trustRegion;
    }
    
    /**
     * Constructor default.
     */
    public Country() {
        
    }
    
    /**
     * Constructor with a param: country name.
     * 
     * @param countryName
     */
    public Country(String countryName) {
        this.countryName = countryName;
    }
    
    /**
     * Constructor with all param.
     * 
     * @param countryID
     * @param countryName
     */
    public Country(int countryID, String countryName) {
        this.countryID = countryID;
        this.countryName = countryName;
    }
    
    /**
     * Get countryID.
     * 
     * @return
     */
    public int getCountryID() {
        return countryID;
    }
    
    /**
     * Set countryID.
     * 
     * @param countryID
     */
    public void setCountryID(int countryID) {
        this.countryID = countryID;
    }
    
    /**
     * Get country name.
     * 
     * @return
     */
    public String getCountryName() {
        return countryName;
    }
    
    /**
     * Set country name.
     * 
     * @param countryName
     */
    public void setCountryName(String countryName) {
        this.countryName = countryName;
    }
    
    /**
     * Get a county.
     * 
     * @return
     */
    public Set<County> getCounty() {
        return county;
    }
    
    /**
     * Set a county.
     * 
     * @param county
     */
    public void setCounty(Set<County> county) {
        this.county = county;
    }
    
}
